import request from '@/utils/request'

// vue-admin-template 项目
// 新增

export function daptAdd(data) {
  return request({
    url: 'http://127.0.0.1:9090/department/add',
    method: 'post',
    data: data
    // headers: {
    //   'Content-Type': 'application/json'  // 如果后端要求 JSON 格式
    // }
  })
}

// List

export function PageList(query) {
  return request({
    url: 'http://127.0.0.1:9090/department/page01',
    method: 'get',
    params: query

  })
}

// 编辑

export function daptEdit(data) {
  return request({
    url: 'http://127.0.0.1:9090/department/update',
    method: 'put',
    data: data
  })
}

// 删除
export function deletDept(id) {
  return request({
    url: 'http://127.0.0.1:9090/department/' + id,
    method: 'delete'
  })
}

// 获取详细
export function getDeptId(id) {
  return request({
    url: 'http://127.0.0.1:9090/department/' + id,
    method: 'get'
  })
}

